package com.jouwee.paranoia;

import java.text.SimpleDateFormat;
import java.util.Date;
import org.bukkit.entity.Player;

/**
 *
 * @author Jouwee
 */
public class Event {
  
    public static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyyy-mm-dd hh:mm:ss"); 
    public static final String SEPARATOR = ";";
    /** Player */
    private Player player;
    /** Date the event happened */
    private Date date;
    
    /**
     * Returns the player.
     * 
     * @return Player
     */
    public Player getPlayer() {
        return player;
    }

    /**
     * Sets the player.
     * 
     * @param player Player
     */
    public void setPlayer(Player player) {
        this.player = player;
    }

    /**
     * Returns the event date.
     * 
     * @return Date
     */
    public Date getDate() {
        return date;
    }

    /**
     * Sets the event date.
     * 
     * @param date Date
     */
    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(DATE_FORMATTER.format(getDate()));
        sb.append(SEPARATOR);
        sb.append(getPlayer().getName());
        return sb.toString();
    }
    
}
